package org.wmq.service.impl;

import org.wmq.Mapper.CommentMapper;
import org.wmq.Mapper.impl.CommentMapperImpl;
import org.wmq.model.Entity.MySimpleMapComment;
import org.wmq.service.CommentService;

import java.io.IOException;

public class CommentServiceImpl implements CommentService {
    private final CommentMapper commentMapper = new CommentMapperImpl();

    @Override
    public boolean setCommentById(Long id, String comment) throws IOException {
        return commentMapper.setCommentByMySimpleMapId(id, comment);
    }

    public boolean updateByMySimpleMapId(MySimpleMapComment comment) throws IOException {
        return commentMapper.updateByMySimpleMapId(comment);
    }

    public boolean deleteByMySimpleMapId(Long mySimpleMapId) throws IOException {
        return commentMapper.deleteByMySimpleMapId(mySimpleMapId);
    }

    public MySimpleMapComment selectByMySimpleMapId(Long mySimpleMapId) throws IOException {
        return commentMapper.selectByMySimpleMapId(mySimpleMapId);
    }
}
